<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/JavaScript">    	
	    function checkId() {
	    	var f = document.join;
	    	var str = f.id.value;
			var err = 0; 
			
			for (var i=0; i<str.length; i++)  { 
				var chk = str.substring(i,i+1); 
				if(!chk.match(/[0-9]|[a-z]/)) { 
					err = err + 1; 
				} 
			} 
			if (err > 0) { 
			     alert("숫자 및 영문소문자만 입력가능합니다.");
			     f.id.focus();
			     return;
			} 
	    }
	    
	    function checkIt() {
			var userinput = document.join;
		
	        if(!userinput.id.value) {
	            alert("ID를 입력하세요");
	            return false;
	        }
	        
	        if(!userinput.passwd.value ) {
	            alert("비밀번호를 입력하세요");
	            return false;
	        }
	        if(userinput.passwd.value != userinput.passwd_re.value)
	        {
	            alert("비밀번호를 동일하게 입력하세요");
	            return false;
	        }	       
	        if(!userinput.name.value) {
	            alert("사용자 이름을 입력하세요");
	            return false;
	        }
	        if(!userinput.email1.value || !userinput.email2.value) {
	            alert("이메일 을 입력하세요");
	            return false;
	        }
	        if(!userinput.phone1.value || !userinput.phone2.value || !userinput.phone3.value) {
	            alert("연락처 를 입력하세요");
	            return false;
	        }
	    }
</script>

<div id="main" class="site-main">
	<div class="entry-content">
			<center>
			<form name="join" action="insertUser.html" method="post" onsubmit="return checkIt()">
			<hr>
			<B>아이디</B><br><br>
			<input type="text" name="id" onBlur="checkId()" placeholder="영문 소문자만 입력하시오" size="30" />
			<br><br>
			
			<B>비밀번호</B><br><br>
			<input type="password" name="passwd" maxlength="20" size="30" />
			<br><br>
			
			<B>비밀번호 확인</B><br><br>
			<input type="password" name="passwd_re" maxlength="20" size="30" />
			<br><br>
			
			<B>이름</B><br><br>
			<input type="text" name="name" maxlength="15" size="30" />
			<br><br>
			
			<B>이메일</B><br><br>
			<input type="text" name="email1" maxlength="15" size="15" />&nbsp;@&nbsp;<input type="text" name="email2" maxlength="15" size="15"/>
			<br><br>
			
			<B>휴대폰</B><br><br>
			<input type="text" name="phone1" maxlength="3" size="7" />&nbsp;-&nbsp;<input type="text" name="phone2" maxlength="4" size="7" />&nbsp;-&nbsp;<input type="text" name="phone3" maxlength="4" size="7" />
			<br><br>
			
			<b>선호 분야</b><br><br>
			<input type=radio name="favorite" value='0'>웹/앱 개발자 &emsp;
			<input type=radio name="favorite" value='2'>웹 개발자 &emsp;
			<input type=radio name="favorite" value='3'>앱 개발자 &emsp;
			<input type=radio name="favorite" value='4'>네트워크 관리자 &emsp;
			<input type=radio name="favorite" value='5'>서버 관리자 &emsp;
			<input type=radio name="favorite" value='6'>보안 전문가 &emsp;
			<input type=radio name="favorite" value='7'>DB 관리자 
			
			<br><br><hr>
				<input type = "submit" value="회원 가입"/> <input type="reset" value="취소"/>
			</form>
			</center>
	</div>
</div>
